import 'package:flutter/material.dart';
import 'package:flutter_pickers/style/picker_style.dart';
import 'package:power_distribution_system/utils/tools/screenutil_tool.dart';


class DownBoxStyle {
  bool isLigt;
  String content;

  DownBoxStyle(bool isLigt, String content) {
    this.isLigt = isLigt;
    this.content = content;
  }

  PickerStyle builder() {
    if(isLigt) {
      return PickerStyle(
        title: Container(
          alignment: Alignment.center,
          child: Text('$content',style: TextStyle(fontSize: 16))
        ),
        showTitleBar: true,
        textColor: Colors.white,
        backgroundColor: Color.fromRGBO(31, 31, 31, 1),
        cancelButton:Container(
          padding: EdgeInsets.only(left: ST.setw(30)),
          child: Text("取消",style: TextStyle(fontSize: 16)),
        ),
        commitButton: Container(
          padding: EdgeInsets.only(right: ST.setw(30)),
          child: Text("确定",style: TextStyle(fontSize: 16)),
        ),
        headDecoration:BoxDecoration(
            color: Color.fromRGBO(31, 31, 31, 1)
        ),
      );
    } else {
      return PickerStyle(
          title: Container(
          alignment: Alignment.center,
          child: Text("$content",style: TextStyle(fontSize: 16))
        )
      );
    }
  }
}